package com.frxuexi.park2304.fragment

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.blankj.utilcode.util.ToastUtils
import com.frxuexi.lib_base.http.WebScoketClient
import com.frxuexi.lib_base.mvi.BaseViewFragment
import com.frxuexi.lib_base.utils.ArouterManager
import com.frxuexi.park2304.R
import com.frxuexi.park2304.databinding.FragmentServiceBinding


class ServiceFragment : BaseViewFragment<FragmentServiceBinding>() {
    override val binding: FragmentServiceBinding by lazy { FragmentServiceBinding.inflate(layoutInflater) }

    override fun initView() {
        binding.servicePark.setOnClickListener {
            ArouterManager.nav(requireContext(),"/park/ParkActivity")
        }

        binding.serviceRepair.setOnClickListener {
            ArouterManager.nav(requireContext(),"/repair/RepairActivity")
        }

        binding.serviceVisit.setOnClickListener {
            ArouterManager.nav(requireContext(),"/visit/VisitActivity")
        }

        binding.serviceNews.setOnClickListener {
            ArouterManager.nav(requireContext(),"/app/NewsActivity")
        }

//        WebScoketClient.myDate.observe(this){
//            ToastUtils.showLong(it)
//        }
//
//        WebScoketClient.start()
        binding.serviceNotice.setOnClickListener {
//            WebScoketClient.sendMessage("hello")
            ArouterManager.nav(requireContext(),"/app/NoticeListActivity")
        }

        binding.serviceSign.setOnClickListener {
            ArouterManager.nav(requireContext(),"/sign/SignActivity")
        }
    }

}